import java.util.Scanner;

/** 
   This program reads information about coins and 
   prints the value of the coins.
*/
public class Coins
{
   public static void main(String[] args)
   {
      // Define constants
      final String P_TYPE = "P";
      final String N_TYPE = "N";
      final String D_TYPE = "D";
      final String Q_TYPE = "Q";

      // Read a number and type of coin 
      System.out.println("Enter number and type of coins: ");

      Scanner in = new Scanner(System.in);
      int numCoins = in.nextInt();
      String typCoin = in.next();

      // Determine and print worth of coin pile
      // Use output statements
      if(typCoin.compareTo(P_TYPE)== 0) System.out.printf("%.2f\n",numCoins * 0.01);
      else if(typCoin.compareTo(N_TYPE)==0) System.out.printf("%.2f\n",numCoins * 0.05);
      else if(typCoin.compareTo(D_TYPE)==0) System.out.printf("%.2f\n",numCoins * 0.10);
      else if(typCoin.compareTo(Q_TYPE)==0) System.out.printf("%.2f\n",numCoins * 0.25);
      else System.out.println("Error");
   }
}